const path = require("path")
const banners = require("./src/mock/banners.json")
const floors = require("./src/mock/floors.json")
function resolve (dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  lintOnSave:false,
  devServer:{
    // before(app){
    //   //app : express核心对象
    //   app.get("/banners",(req,res)=>{res.json({ data: banners,code:200})});
    //   app.get("/floors",(req,res)=>{res.json({ data: floors,code:200})})
    // },
    proxy: {
      '/9000': {
        target: 'http://localhost:9000',
        pathRewrite: { '^/9000': '' },
      }
    },
  },
  configureWebpack:{
    resolve: {
      alias: {
        "components":resolve("src/components"),
        "pages":resolve("src/pages"),
        "router":resolve("src/router"),
        "routes":resolve("src/routes"),
        "store":resolve("src/store"),
        "api":resolve("src/api"),
        "mock":resolve("src/mock")
      }
    }
  }
}
